home *** CD-ROM | disk | FTP | other *** search
File List | 1987-06-16 | 4.0 KB | 176 lines |
- '
- ' I think the GEnie handle of the author of this program is NTACTONE,
- ' whomever that is.... I've taken it and added alerts and status lines
- ' to let you know what's going on... Also added a printer check, and better
- ' file handling (selector boxex, etc) and a restart ability. Enjoy!
- '
- ' Wm. A. Van Nest, Sr., President, VanGuard Datasystems
- ' BBS # 301-577-3659 (MichTron BBS of course, 300/1200/2400 baud)
- '
- Cls
- Dim A$(10000),Label(1000),Label$(1000),Procs(1000),Procs$(1000),Funcs(1000),Funcs$(1000)
- Beginning:
- Close
- Cls
- Print " Select the program name... It MUST be a .LST ('Save,A') file!"
- Fileselect "\*.LST","",Inp$
- If Inp$="" Or Right$(Inp$,1)="\"
- Goto Leave
- Endif
- Cls
- Open "I",#1,Inp$
- Print At(1,10);"Reading line:";
- Repeat
- Print At(50,10);X%;
- Line Input #1,A$(X%)
- Inc X%
- Until Eof(#1)
- Numlines%=X%-1
- Cls
- Print At(1,10);"Working on line:";
- For X=1 To Numlines%
- Print At(50,10);X;
- Flg=0
- Gosub Find_proc
- Gosub Find_label
- Gosub Find_funcs
- Next X
- Cls
- Testprint:
- If Not (Gemdos(&H11))
- Alert 1,"Printer not ready!",1,"Retry|Abort",Button
- If Button=1
- Goto Testprint
- Else
- Goto Leave
- Endif
- Endif
- Gosub Prlabs
- Gosub Prprocs
- Gosub Prfuncs
- Alert 2,"Do you want to print|the entire program?",1,"Yes|No",Button
- If Button=1
- Gosub Listpgm
- Endif
- Leave:
- Alert 2,"Do another?",1,"Yes|No",Button
- If Button=1
- Goto Beginning
- Endif
- System
- Procedure Find_proc
- If Instr(A$(X),"Procedure")
- Aa=Instr(A$(X),Chr$(34))
- If Aa
- Goto Nogo
- Else
- Cnt=11
- Gosub Procnmebld
- Procs(Proccnt)=X
- Procs$(Proccnt)=Procname$
- Inc Proccnt
- Endif
- Nogo:
- Endif
- Return
- Procedure Find_funcs
- If Instr(A$(X),"Deffn")
- Aa=Instr(A$(X),Chr$(34))
- If Aa
- Goto Nogo1
- Else
- Cnt=6
- Gosub Procnmebld
- Funcs(Funcscnt)=X
- Funcs$(Funcscnt)=Procname$
- Inc Funcscnt
- Endif
- Nogo1:
- Endif
- Return
- Procedure Find_label
- Flg=0
- B=Instr(A$(X),":")
- If B Then
- C=Instr(A$(X),Chr$(34))
- If C>0 And C<B Then
- Goto Nogoa
- Else
- Label(Labcnt)=X
- Gosub Unspace
- Label$(Labcnt)=A$(X)
- Inc Labcnt
- Endif
- Nogoa:
- Endif
- Return
- Procedure Unspace
- Void Fre(0)
- For Unsp=1 To Len(A$(X))
- Exit If Mid$(A$(X),Unsp,1)<>" "
- Next Unsp
- A$(X)=Mid$(A$(X),Unsp)
- Return
- Procedure Procnmebld
- For Temp=11 To Len(A$(X))
- T$=Mid$(A$(X),Temp,1)
- Exit If T$="("
- Exit If T$=" "
- Next Temp
- Procname$=Mid$(A$(X),Cnt,Temp-Cnt)
- Return
- Procedure Prlabs
- If Labcnt
- Cls
- Print At(1,10);"Printing Labels...";
- Lprint
- Lprint "**********************************************"
- Lprint " Line # Label"
- Lprint "**********************************************"
- For X=0 To Labcnt-1
- Print At(50,10);X;
- Lprint ,Label(X),Label$(X)
- Next X
- Endif
- Return
- Procedure Prprocs
- If Proccnt
- Cls
- Print At(1,10);"Printing Procedures...";
- Lprint
- Lprint "**********************************************"
- Lprint " Line # Procedures"
- Lprint "**********************************************"
- For X=0 To Proccnt-1
- Print At(50,10);X;
- Lprint ,Procs(X),Procs$(X)
- Next X
- Endif
- Return
- Procedure Prfuncs
- If Funcscnt
- Cls
- Print At(1,10);"Printing Functions...";
- Lprint
- Lprint "**********************************************"
- Lprint " Line # Functions"
- Lprint "**********************************************"
- For X=0 To Funcscnt-1
- Print At(50,10);X;
- Lprint ,Funcs(X),Funcs$(X)
- Next X
- Endif
- Return
- Procedure Listpgm
- Cls
- Print At(1,10);"Printing the program...";
- Lprint
- Lprint "============================================="
- Lprint " Program Lines"
- Lprint "Line# | Program line"
- Lprint "============================================="
- For X=0 To Numlines%
- Lprint X;Tab(8);A$(X)
- Next X
- Return
-